var ot_reject = null;
var audit = null;
var td = null;

$(function() {
	ot_reject = $("#ot_reject");
	audit = $("#audit");
	td = $("#td");
	function validateTip(element, placeholder, value, css, status) {
		element.attr("placeholder", value);
		element[0].style.border = css;
		element.attr("validateStatus", status);
	}
	td.bind("click",function(){
		if (ot_reject.val() == null || ot_reject.val().length < 1) {
			validateTip(ot_reject, "placeholder", "请填写驳回意见！", "1px solid red",
					false);
		} else {
			validateTip(ot_reject, "", "", "1px solid #ccc", true);
			if (confirm("是否确认驳回？")) {
				$("#form_demo").submit();
			}
		}
	})
	audit.bind("click",function(){
			if (confirm("是否确认审核通过？")) {
				$("#form_demo").submit();
			}
	})
})

$.validator.setDefaults({
	submitHandler : function() {
		alert("修改成功");
	}
});
$().ready(function() {
	$("#form_demo").validate();
});
function change() {
	var height01 = $(window).height();
	$(".top").css('height', height01 - 35 + "px");
}
/*
 * !function() { laydate.skin('molv');//切换皮肤，请查看skins下面皮肤库 laydate({ elem :
 * '#em_registrationtime' });//绑定元素 }();
 */

/*function audit(em_number) {
	var em_number = em_number;
	$.ajax({
		url : 'audit_salary.json',
		type : 'POST',
		dataType : 'json',
		data : {
			"em_number" : em_number
		},
		success : function(data) {
			if (data.result == false) {
				alert("审核失败！")
			}
		}
	})

}*/
/*
 * function td(em_number) { var em_number = em_number; var ot_reject=ot_reject
 * if (confirm("确定驳回吗？")) { $.ajax({ url : 'td_salary.json', type : 'POST',
 * dataType : 'json', data : { "em_number" : em_number, "ot_reject":ot_reject },
 * success : function(data) { if (data.result == false) { alert("驳回失败！") } } }) }
 *  }
 */